package socketUtil

import (
	"net/http"
	"golang.org/x/net/websocket"
)

type SocketConn struct {
	conn *websocket.Conn
}

func (conn SocketConn)ReadLoop()  {

}
func Websocket(pattern string) SocketConn {
	var socketConn SocketConn
	f := func(conn *websocket.Conn) {
		socketConn = SocketConn{
			conn: conn,
		}
	}
	http.Handle(pattern, websocket.Handler(f))
	return socketConn
}
